package com.itheima.health.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.health.mapper.ReportMapper;
import com.itheima.health.service.ReportService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
@Transactional
public class ReportServiceImpl  implements ReportService {


    @Autowired
    private ReportMapper reportMapper;

    @Override
    public Map memberReportByLastYear() {
        List<Map> mapList = reportMapper.memberReportByLastYear();
        Map map = new HashMap();
        changeMap(map,mapList);
        return map;
    }

    @Override
    public List<Map> setmealProportion() {

        return reportMapper.setmealProportion();
    }

    private void changeMap(Map map, List<Map> mapList) {
             //  遍历集合 将 数据  封装到 Map中  membercounts      yearsandmonth
    }
}
